翻訳と辞書
Words near each other
・ Javad-e Seyyedi
・ Javadabad
・ Javadabad (disambiguation)
・ Javadabad District
・ Javadabad, Delfan
・ Javadabad, Fars
・ Javadabad, Garmsar
・ Java EE version history
・ Java Embedding Plugin
・ Java Evolutionary Computation Toolkit
・ Java Formation
・ Java Foundation Classes
・ Java Gold
・ Java Grammatical Evolution
・ Java GUI for R
Java hashCode()
・ Java Head (1923 film)
・ Java Head (1934 film)
・ Java Head (disambiguation)
・ Java Heat
・ Java Heterogeneous Distributed Computing
・ Java Ho!
・ Java Interface Definition Language
・ Java Jive
・ Java Joel
・ Java Lane SC
・ Java loach
・ Java logging framework
・ Java Man
・ Java Management Extensions


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Java hashCode() : ウィキペディア英語版
Java hashCode()

In the Java programming language, every class implicitly or explicitly provides a hashCode() method, which digests the data stored in an instance of the class into a single hash value (a 32-bit signed integer). This hash is used by other code when storing or manipulating the instance – the values are intended to be evenly distributed for varied inputs in order to use in clustering. This property is important to the performance of hash tables and other data structures that store objects in groups ("buckets") based on their computed hash values. Technically, in Java, hashCode() by default is a native method, meaning, it has the modifier 'native', as it is implemented directly in the native code in the JVM.
==hashCode() in general==
All the classes inherit a basic hash scheme from the fundamental base class java.lang.Object, but instead many override this to provide a hash function that better handles their specific data. Classes which provide their own implementation must override the object method public int hashCode().
The general contract for overridden implementations of this method is that they behave in a way consistent with the same object's equals() method: that a given object must consistently report the same hash value (unless it is changed so that the new version is no longer considered "equal" to the old), and that two objects which equals() says are equal ''must'' report the same hash value. There's no requirement that hash values be consistent between different Java implementations, or even between different execution runs of the same program, and while two ''unequal'' objects having different hashes is very desirable, this is not mandatory (that is, the hash function implemented doesn't need to be a perfect hash).〔(java.lang.Object.hashCode() documentation ), Java SE 1.5.0 documentation, Oracle Inc.〕
For example, the class Employee might implement its hash function by composing the hashes of its members:

public class Employee


抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Java hashCode()」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.